#pragma once
#include "isocketkernel.h"
#include <vector>
using namespace std;


namespace cupid
{

class IListenSocket;
class IServerSocket;
class IMessagePort;
class SocketKernel :
	public ISocketKernel
{

public:
	ISocketKernel*	getInterface() { return (ISocketKernel*)this; }

public:
	virtual bool	create(IMessagePort* port);
	virtual bool	processMsg(int idPacket, void* buf, int type, int from);
	virtual bool	processSocket();
	virtual bool	onTimer(time_t cur);
	virtual bool	release();

protected:
	void			acceptNewSocket();

protected:
	IListenSocket*	m_listen;
	vector<IServerSocket*>	m_setSocket;
	vector<int>		m_setProcessID;
	IMessagePort*	m_msgPort;
};

}